const path = require('path');
const htmlPlu = require('html-webpack-plugin');
const vuePlu = require('vue-loader/lib/plugin');
module.exports = {
    mode: "development",
    entry: ['./src/index.js'],
    output: {
        path: path.resolve(__dirname, 'dist'),
        filename: 'bundle.js'
    },
    module: {
        rules: [
            { test: /\.(css|less)$/, use: ['style-loader', 'css-loader', 'less-loader'] },
            { test: /\.(png$|jpeg$|jpg$|svg)$/, use: ['file-loader?name=[hash:16]-[name].[ext]&limit=50000&outputPath=img', 'image-webpack-loader'] },
            { test: /\.vue$/, use: ['vue-loader'] },
            { test: /\.js$/, use: ['babel-loader'] }
        ]
    },
    plugins: [
        new vuePlu(),
        new htmlPlu({ template: "./src/template.html" })
    ]
};